import * as moment from 'moment';
import { observable, computed, action } from 'mobx';
import { Promise } from 'drunk-base';
import { getTopicList, deleteTopic, search } from './TopicHttpResource';
import { ITopicModel } from './TopicModel';
import { ListModel } from '../../ListModel';

export class TopicListModel extends ListModel<ITopicModel> {

    deleteItemImpl(id: string) {
        return deleteTopic(id);
    }

    fetchListImpl(page: number, size: number) {
        return getTopicList(page, size);
    }

    searchImpl(name: string, startTime: number, endTime: number, page: number, size: number) {
        return search(name, startTime, endTime, page, size);
    }
}